import java.io.Serializable;
public class Student  implements Serializable {
    private int id;
    private String name;
    private int age;
    private static final long serialVersionUID = -2578986260693479329L;
    public Student() {
    }

    public Student(int id, String name, int age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        if(id>0){
            this.id = id;
        }else {
            try {
                throw  new id("id设置不正确哦");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        try {
            if(age>0){
                this.age = age;
            }else {
                throw new old("这不是正经人的年龄哦");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
